#1 List Slice
L = ['Michael','Sarah','Tracy','Bob','Jack']
L[0:3]


#the first 10 
L[:10]

#the last 10
L[-10:]


#2 Iterable
from collections import Iterable
isinstance('abc',Iterable)
>>>True

for i,value in enumerate(['A','B','C'])
    print(i,value)


#3 List Comprehensions
[x * x for x in range(1,11)]

[x * x for x in range(1,11) if x % 2 == 0]

[m + n for m in 'ABC' for n in 'XYZ']

L = ['Hello','World','IBM','Apple']
[s.lower() for s in L]

L = ['Hello','World',18,'Apple',None]
[s.lower() for s in L if isinstance(s,str)]


#4 generator
L = [x*x for x in range(10)] #list comprehensions
g = (x*x for x in range(10)) # generator
next(g)...

#5 Iterator
if a object can 'for ...in..',then call it is Iterable type
if a object can 'next()',then call it is Iterator type
list,dict,str are Iterable not Iterator, except use iter() 
